/// *
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package main_com.Controlers.date.old;
//
//import jakarta.servlet.http.HttpServletRequest;
//import jakarta.servlet.http.HttpServletResponse;
//import jakarta.servlet.http.HttpSession;
//import main_com.mapper.DateMapper;
//import main_com.pojo.LoginBean;
//import main_com.pojo.LookDateBean;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import java.util.ArrayList;
//
///**
// * @author Administrator
// */
//@Controller
//@RequestMapping("/LookDateController")
//public class LookDateController {
//    @Autowired
//    DateMapper dateMapper;
//
//    @RequestMapping("/lookDate")
//    protected void lookDate(HttpServletRequest request, HttpServletResponse response) {
//        try {
//            String userName = "";
//            HttpSession session = request.getSession();
//            ArrayList login = (ArrayList) session.getAttribute("login");
//            if (login == null || login.isEmpty()) {
//                response.sendRedirect("http://localhost/login.jsp");
//                return;
//            } else {
//                for (int i = login.size() - 1; i >= 0; i--) {
//                    LoginBean nn = (LoginBean) login.get(i);
//                    userName = nn.getUserName();
//                }
//            }
//            String sql = "select * from date where userName='" + userName + "'";
//            ArrayList<LookDateBean> datelist = dateMapper.getDateByUserName(userName);
//            session.setAttribute("datelist", datelist);
//            response.sendRedirect("http://localhost/dateManager/lookDate.jsp");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//
//
//}